# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-extruct
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=extruct
pkgver=0.16.0
pkgrel=3
pkgdesc="Extract embedded metadata from HTML markup"
url="https://pypi.python.org/project/extruct"
license="BSD-3-Clause"
arch="noarch"
depends="
		py3-lxml
		py3-pyrdfa3
		py3-mf2py
		py3-w3lib
		py3-html-text
		py3-six
		py3-jstyleson
		py3-requests
		"
checkdepends="py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/scrapinghub/extruct/archive/refs/tags/v$pkgver.tar.gz
	217_add-support-lxml-5.1.0.patch
	214_fix-syntaxwarning.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
bb9f831a84e28f7bb6b9a1464fdc76801d72a57014ce83b2459e1acf9cf5f28e45ae94b5a89e5c239e9fd57d0585baa02e7f9c3650bb46cc5861df4362eda724  py3-extruct-0.16.0.tar.gz
8d317c0f18b7acc895f9fd18171389303eb82c592c08b7d77e605f950a329938da33892e4d5241bda623e6dd55e8d302a5cf7c9eef583c0b228e3ee3a203ef15  217_add-support-lxml-5.1.0.patch
cd923aaecdfe7c49c94b947b285e799474810a379fb62cc82b2388a88feadd6d9b27161a38b786ffec18511b86ece72443d68d2adcf0065cc2793e747449ae3d  214_fix-syntaxwarning.patch
"
